<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>symbol</title>
</head>
<body>
    <script>
        const s1 = Symbol();
        const s2 = Symbol();
        const obj = {
            name:"cq",
            [s1]:"傻逼",
            [s2]:"你才是傻逼"
        }
        console.log(obj.name);
         
        //只能获取非symbol
        const keys = Object.keys(obj);
        console.log(keys);

        const arr = Object.getOwnPropertySymbols(obj);
        for(key of arr)
        {
            console.log(obj[key]);
        }
        console.log(arr);
    </script>
</body>
</html>